package com.fourth;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author LJX
 * @Description: TODO
 * @Date: 2023/2/23 9:44
 * @Version 1.0
 */
@SpringBootApplication
@MapperScan(basePackages = "com.fourth.dao")
@ComponentScan(basePackages = {"com.fourth","com.ljx.security.util", "com.ljx.security","com.ljx.config"})
public class SystemApp {
	@Bean
	public PasswordEncoder passwordEncoder() {
		//加盐加密: 原密码+盐===>哈希加密===>密文
		//   原密码===>哈希加密===>密文 [存储大量常见的密文]
		//123456+随机产生盐===>密文
		return new BCryptPasswordEncoder();
	}

	public static void main(String[] args) {
		SpringApplication.run(SystemApp.class,args);
	}
}
